<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link th:href="@{/css/web.css}" rel="stylesheet">
    <script type="text/javascript" th:src="@{https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js}"></script>
    <style>
        .pagenum{
            text-align: center;
            clear: both;
            padding-top: 20px;
        }
        .pagenum ul{
            list-style-type: none;
            margin-left: 40%;
        }
        .pagenum li{
            float: left;
            width: 50px;
            height: 50px;
            border: 1px solid  #FF5000;
            line-height: 50px;
        }
        .pagenum a{
            display: inline-block;
            width: 100%;
            height: 100%;
            color: #FF5000;

        }
        .pagenum a:hover{
            background-color: #FF5000;
            color: white;
        }
    </style>
</head>
<body>
<!--显示商品名字-->
<div class="product" th:each="product:${productPage.getList()}">
    <!--商品图片配置虚拟路径-->
    <img th:src="@{'/'+${product.pimg}}"/><!---->
    <p><span class="name" th:text="${product.pname }"></span><span class="price" th:text="${product.price }"></span></p>
    <p class="info" th:text="${product.info }"></p>
    <a href="javascript:void(0)" class="btn">加入购物车</a>
</div>
<!--页码-->
<div class="pagenum">
    <ul>
        <li><a th:href="@{/admin/index}">home</a></li>
        <!--上一页-->
        <li><a th:href="@{/admin/index(pageNum=${currPageNum}-1)}">pre</a></li>
        <!--遍历所有页码  PageInfo-->
        <li th:each="pagenum:${productPage.navigatepageNums}">
            <a th:href="@{/admin/index(pageNum=${pagenum})}" th:text="${pagenum}"></a>
        </li>
        <!--下一页-->
        <li><a th:href="@{/admin/index(pageNum=${currPageNum}+1)}">next</a></li>
        <li><a th:href="@{/admin/index(pageNum=${productPage.getPages()})}">end</a></li>
    </ul>
</div>
<br>
<br>
<br>
<br>
</body>
</html>